#pragma once


/**
 *  Module implements a secrecy system based on Advanced Encryption Standard (AES):
 * 
 * 
 * @author Ravi Mohandas, Mar 06 2011
 *
 */



#ifdef SECRECYSYSTEM_EXPORTS
#define SECRECY_SYSTEM_API __declspec(dllexport)
#else
#define SECRECY_SYSTEM_API __declspec(dllimport)
#endif



/**================================
 * Public interface for this Module
 * =================================
 */
extern "C" {

	
	/**
	 * basic byte type 
	 * 
	 */
	
	typedef unsigned char byte;

/**
 * Choice of Secrecy Levels available.
 */	

typedef enum SecrecyLevel { Strong, Very_Strong, Maximum } SecrecyLevel ;

SECRECY_SYSTEM_API SecrecyLevel; // export the enum



	/**
	 *	initialize the secrecy system
	 *
	 *  An application calls this method first preparing the 
	 *  the system for secrecy operations. 
	 * 
	 */

SECRECY_SYSTEM_API  
int Init(void);


	/**
	 *	shutdown the secrecy system
	 *
	 *  An application calls this method first preparing the 
	 *  the system for secrecy operations. 
	 * 
	 */

SECRECY_SYSTEM_API 
int Close(void);

	/**
	 * Configure the strength of the secrecy operations performed on a message. 
	 * 
	 */
SECRECY_SYSTEM_API 
int Configure_SecrecyLevel (SecrecyLevel level);


	/**
	 * Configure the Key Stream to perform the secrecy operations. 
	 * 
	 */

SECRECY_SYSTEM_API 
int Configure_KeyStream (byte keyBytes [], int length);


	/**
	 * Protect user data
	 * 
	 */

SECRECY_SYSTEM_API 
int  Protect (const byte in[], const byte out[], int length);


/**
 * UnProtect user data
 * 
 */

SECRECY_SYSTEM_API 
int  UnProtect (const byte in[], const byte out[], int length);
};